package net.aiform.entity.org;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.aiform.entity.IdEntity;


/**
 * Organization entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "organization")
public class Organization extends IdEntity {

	// Fields
	private Organization organization;
	private String orgName;
	private String remark;
	private Set<Organization> organizations = new HashSet<Organization>(0);
	private Set<Sysuser> sysusers = new HashSet<Sysuser>(0);

	// Constructors

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORG_ID")
	public Organization getOrganization() {
		return this.organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

	@Column(name = "ORG_NAME", length = 128)
	public String getOrgName() {
		return this.orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	@Column(name = "REMARK", length = 256)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "organization")
	public Set<Organization> getOrganizations() {
		return this.organizations;
	}

	public void setOrganizations(Set<Organization> organizations) {
		this.organizations = organizations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "organization")
	public Set<Sysuser> getSysusers() {
		return this.sysusers;
	}

	public void setSysusers(Set<Sysuser> sysusers) {
		this.sysusers = sysusers;
	}

}